<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        /* 
        给量词的情况下  默认取最大值 默认是贪婪的
        */
        var str =   " a 'witch'nice'broom' and her 'broom' is one";
        console.log(str.match(/'.+'/g));//贪婪模式
        console.log(str.match(/'.+?'/g));//懒惰模式
    </script>

    <!-- 过滤标签 -->
    <script>
        var arr = "<p>dhauwidgwueah</p><p> <div></div><>< ><1>";
        /*这里加号是表面[]里面包含多个字符。
        例如，<dabcd>,<idd>,<voop>等都会被查找到*/
        var reg = /<[^\s]*>/g; 
        console.log(arr.match(reg));
        console.log(arr.match(/<[^\s]*?>/g));
    </script>

</body>
</html>